import './index.css'
import React from "react";
import { observer, inject } from "mobx-react";
@inject("sheetStore")
@observer
class GxlSelectedArea extends React.Component {
  rectStyle(){
    const { sheetStore } = this.props;
    const selectedRects = sheetStore.selectedRects;
    console.log(selectedRects)
    const rect = selectedRects[0]
    if(!rect){
      return {}
    }
    // let left=0,top=0
    // selectedRects.forEach((rect)=>{

    // })
    return {left:rect.offsetLeft-1,top:rect.offsetTop-1,width:rect.width+1,height:rect.height+1}
  }
  render() {
    
    return (
      <div className="selected-area" style={this.rectStyle()}>
      </div>
    );
  }
}

export default GxlSelectedArea;